package org.example.user.statistic.form;

import lombok.Data;
import org.springframework.util.StringUtils;

import java.util.Date;

/**
 * 出入健康记录 查询表单实体
 *
 * @author bothin
 */
@Data
public class HealthRecordSearchForm {
    private Integer page = 1;
    private Integer size = 10;
    private Boolean isAsc = true;
    private String field = "";


    private String userName = "";
    private String adminName = "";
    private Integer passStatus;
    private Integer passResult;
    private Integer healthStatus;

    private String recordAddress = "";

    private Date[] dates;

    public Date[] getDates() {
        if (dates==null || dates.length<2){
            dates = new Date[2];
        }

        if (StringUtils.isEmpty(dates[0])) //如果没有传查询时间，初始化
            dates[0] = null;
        if (StringUtils.isEmpty(dates[1]))
            dates[1] = null;
        return dates;
    }
}
